#ifndef _FUN_H_
#define _FUN_H_

#include <vector>

const int X_WIDTH = 8;
const int Y_WIDTH = 8;

typedef std::vector< std::vector<int> > CSqure;
typedef std::pair<int, int> CCoordinate;
class CCoordinateGroup : public std::vector<CCoordinate> 
{
public:
	bool Find(size_t x, size_t y);
	void Merge(const CCoordinateGroup& other);
};

extern CSqure squre;

void InitSqure(CSqure& squre);
void CreateSqure(CSqure& squre);
int ClickSqure(CSqure& squre, CCoordinate& first, CCoordinate& second);
int ProcessSqure(CSqure& squre);
int PrintSqure(CSqure& squre, const char * promot = NULL);
int CheckSqure(const CSqure& squre, std::vector<CCoordinateGroup>& groups);
void MoveGroup(CSqure& squre);
#endif